<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitionalx	//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ include file="jspmodules/init.jsp"%>

<%@page import="com.javandad.app.server.entity.Fodo" %>
<%@page import="java.util.List" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%
	if (view == null) {

		response.sendRedirect("login.jsp?" + codesvrParam);

	}
%>


<title><%=view.toString()%> - JaVandad</title>

<link href="Javandad.css" rel="stylesheet" type="text/css">


<!-- 
 -->
<script type="text/javascript" language="javascript"
	src="login/login.nocache.js"></script>
<script type="text/javascript" language="javascript"
	src="com.javandad.app.TopPanel/com.javandad.app.TopPanel.nocache.js"></script>
<script type="text/javascript" language="javascript"
	src="com.javandad.app.Register/com.javandad.app.Register.nocache.js"></script>
	<script type="text/javascript" language="javascript"
	src="com.javandad.app.HomeComponent/com.javandad.app.HomeComponent.nocache.js"></script>

</head>


<body style="font-family: sans-serif;" >
<iframe src="javascript:''" id="__gwt_historyFrame"
	style="position: absolute; width: 0; height: 0; border: 0"></iframe>

<div
	style="position: absolute; overflow: auto; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<table style="width: 100%; height: 100%;" border=0>
	<tr height="5%">
		<td style="background-color: #707dbe;">
		<table width="100%" height="100%" border=0>
			<tr>
				<td valign="top">
				<table align="left" width="100%">
					<tr>
						<td style="vertical-align: top"><a href="login.jsp"><img alt="Vandad Logo"
							src="img/logo.jpg" width="200" height="50" /></a></td>
						
						<td id="topPanel" style="white-space: nowrap;"></td>
						
						<td align="right"
							style="vertical-align: top; text-align: right; width: 100%;">

<jsp:include page="jspmodules/headerMenu.jsp">
						<jsp:param value="<%= codesvrParam %>" name="codesvrParam"/>
						</jsp:include>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
   
	
	
							
	<tr height="85%">
<div  id="messageDialog"></div>


		<td width="100%" valign="top">
		<table width="100%" height="100%" border="0">
			<tr height="100%" align="left">
				<td width="80%" valign="top">
				<table width="100%" height="100%">
					<tr height="100%">
						<td valign=top width="20%	"><jsp:include
							page="jspmodules/viewMenu.jsp">
<jsp:param value="<%= codesvrParam %>" name="codesvrParam"/>
<jsp:param value="<%= viewParams %>" name="viewParams"/>
<jsp:param value="<%= view.getUsername() %>" name="view"/>
							</jsp:include>

						<td valign="top">
						<table width="100%" height="100%" border='0'>
							<tr height="48">
								<td>
								<table>
									<tr>		<td><img width=48 height=48 src="img/icons/home.png"></img></td>
										<td>
										<h2>
										<%
											if (view == user) {
												out.println("Welcome " + view  + "( " + view.getUsername() + " )");
											} else {
												out.println(view.getFirstName() + " " + view.getLastName() + (((view.getUsername() != null && !view.getUsername().isEmpty()) || ((view.getCountry() != null && !view.getCountry().isEmpty())) ? "'s Home Page" : view.getUsername() + "'s home page")));
											}
										%>
										</h2>
										</td>
									</tr>
								</table>
								</td>
							</tr>
							
							<tr height=100>
								<td>
								<table width="100%" height="100%">
									<tr height="50%" valign="top">
										<td width="50%">
										<table align=left>
											<%
												if (view != user) {
											%>
											
											<tr>
												<td>
												<table><tr><td><table>
												<tr><td>Username</td><td><b><%= view.getUsername() %></b></td></tr>
												<tr><td>Email</td><td><b><%= view.getEmail() %></b></td></tr>
												<tr><td>Cell</td><td><b><%= view.getCellNo() %></b></td></tr>
												<tr><td>Phone</td><td><b><%= view.getPhoneNo() %></b></td></tr>
												<tr><td>Location</td><td><b><%= view.getCity() + " " + view.getCountry() %></b></td></tr>
												
												
												
												</table></td>
												<% List<Fodo> fodos = DatabaseManager.getDefaultDatabaseManager().getFodos(view.getUsername(),null, PMFSingleton.getPM());
												   for(int i =0 ; i < fodos.size() && i < 5 ; ++i){
												     %>
												     <td><img height = "100" width='100' src="/image?id=<%= fodos.get(i).getId() %>"></img></td>
												<%
												   }
												%>
												</tr></table>
												</td>
											</tr>
											<%
												} else {
											%>
											

											<tr>

												<td><a href="/messagebox.jsp">New Messages</a></td>
												<td><a href="/messagebox.jsp">New Invitations</a></td>
											</tr>
																						<%
												}
											%>
										</table>
										</td>
									</tr>
									
								</table>
								</td>
							</tr>
																					<tr valign="top"><td><div id="homeContainer"></div></td></tr>
							
						</table>
						</td>

					</tr>
				</table>
				</td>
				<%@ include file="jspmodules/search.jsp"%>
			</tr>


		</table>
		</td>
	</tr>
	<%@ include file="jspmodules/bottom.jsp"%>
</table>

</div>
</body>
</html>

